﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Apprenda.SaaSGrid;

namespace SaaSKit.Taskr.Service
{
    public static class ActivityDTOExtension
    {
        public static Activity MapTo(this ActivityDTO dto)
        {
            return new Activity(dto.TaskId, dto.Description);
        }

        public static void MapFrom(this ActivityDTO dto, Activity instance)
        {
            if (instance == null)
            {
                return;
            }

            dto.TaskId = instance.TaskId;
            dto.Author = instance.Author;
            dto.CreatedDate = instance.CreatedDate;
            dto.Description = instance.Description;
        }
    }
}
